<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<script type="text/javascript">
	$(function() {
		var $grid = $('#grid_work');
		var $title = '工作经历';
		var $baseUrl = 'hrm/work';
		$grid.datagrid({
			title : $title + '列表',
			url : $baseUrl + '/page?sort=user.id,asc&sort=sort,asc',
			dialog : {
				url : $baseUrl,
				name : $title,
				create : {
					width : 660,
					height : 500
				},
				update : {
					width : 660,
					height : 500
				}
			},
			pagination : true,
			pageSize : 50,
			pageList : [ 50, 100, 200 ],
			columns : [ [ {
				field : 'name',
				width : 120,
				title : '公司名称'
			}, {
				field : 'user',
				width : 80,
				title : '员工',
				formatter : function(value, row, index) {
					return row.user ? row.user.name : '';
				}
			}, {
				field : 'feature',
				width : 60,
				title : '公司性质'
			}, {
				field : 'industry',
				width : 60,
				title : '所属行业'
			}, {
				field : 'feature',
				width : 60,
				title : '公司性质'
			}, {
				field : 'size',
				width : 120,
				title : '公司规模'
			}, {
				field : 'dept',
				width : 60,
				title : '部门'
			}, {
				field : 'duty',
				width : 60,
				title : '职务'
			}, {
				field : 'pay',
				width : 80,
				title : '月薪'
			}, {
				field : 'reterence',
				width : 60,
				title : '证明人'
			}, {
				field : 'telphone',
				width : 60,
				title : '联系电话'
			}, {
				field : 'leaving',
				width : 120,
				title : '离职原因'
			}, {
				field : 'startDate',
				width : 120,
				title : '开始日期'
			}, {
				field : 'endDate',
				width : 120,
				title : '结束日期'
			}, $.fields.description, $.fields.sort ] ],
			toolbar : [ <sec:authorize access="hasRole('HRM_WORK_ADD')"> $.crudgrid.buttons.create,</sec:authorize><sec:authorize access="hasRole('HRM_WORK_EDIT')"> $.crudgrid.buttons.update, </sec:authorize><sec:authorize access="hasRole('HRM_WORK_DELETE')">$.crudgrid.buttons.remove,</sec:authorize> '-', $.crudgrid.buttons.refresh ]
		}).treegrid('filter.init');
	});
</script>
<div class="easyui-layout" data-options="fit:true">
	<div data-options="region:'center',split:true,border:false">
		<table id="grid_work"></table>
	</div>
</div>